<?php

namespace App\Model\Table;

use App\Entity\User;
use Wonfu\Core\Database\CakeBaseTable;

class UserTable extends CakeBaseTable
{
    protected $mapper = User::class;

    public function initialize(array $config): void
    {
        $this->setAlias('user');
        $this->hasMany('address')
            ->setClassName(AddressTable::class)
            ->setBindingKey('id')->setForeignKey('user_id')->setProperty('addresses');
    }



}